package com.intertid.mongodb.commons
import javax.servlet.ServletContextListener
import javax.servlet.ServletContextEvent
import com.intertid.mongodb.Mapper

class MongoDBListener extends ServletContextListener {
  // public abstract void contextInitialized(ServletContextEvent paramServletContextEvent);
  //
  //  public abstract void contextDestroyed(ServletContextEvent paramServletContextEvent);

  def contextInitialized(context: ServletContextEvent): Unit = {
    val domainPackname = context.getServletContext().getInitParameter("MONGODB_DOMAIN_PACK");
    Mapper.init(domainPackname);
  }

  def contextDestroyed(context: ServletContextEvent): Unit = {

  }
}